package com.example.repository;

import com.example.entity.Vehicle;
import com.example.entity.VehicleStatus;
import com.example.entity.VehicleType;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;

public interface VehicleRepository extends JpaRepository<Vehicle, String> {
    List<Vehicle> findByStatus(VehicleStatus status);
    
    // 查询可用的公司车辆
    List<Vehicle> findByCompanyOwnedTrueAndStatus(VehicleStatus status);
    
    // 查询可用的自动驾驶车辆
    List<Vehicle> findByIsAutonomousTrueAndStatus(VehicleStatus status);
    
    // 根据类型和状态查询非自动驾驶车辆
    List<Vehicle> findByTypeAndStatusAndIsAutonomousFalse(VehicleType type, VehicleStatus status);
}